package com.rf.richfitwheel.admin.sys.dao;

import com.rf.richfitwheel.admin.sys.model.UserRole;
import com.rf.richfitwheel.admin.sys.model.UserRoleExample;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

public interface UserRoleMapper {
    long countByExample(UserRoleExample example);

    int deleteByExample(UserRoleExample example);

    int deleteByPrimaryKey(String id);

    int insert(UserRole record);

    int insertSelective(UserRole record);

    List<UserRole> selectByExample(UserRoleExample example);

    UserRole selectByPrimaryKey(String id);

    int updateByExampleSelective(@Param("record") UserRole record, @Param("example") UserRoleExample example);

    int updateByExample(@Param("record") UserRole record, @Param("example") UserRoleExample example);

    int updateByPrimaryKeySelective(UserRole record);

    int updateByPrimaryKey(UserRole record);

    /**  
	 * 根据角色id查询关联的用户(含用户名、用户姓名)
	 * @param roleId
	 * @return  
	 */ 
	List<Map<String, Object>> selectByRoleId(String roleId);

	/**  
	 * 获取有效用户，不包含已添加的用户
	 * @param queryPra 
	 * @return  
	 */ 
	List<Map<String, Object>> selectByRoleIdNoChoose(Map<String, String> queryPra);
    
    /**
     * 只删除对应模块的记录
     * @param params {userId:"", moduleType: [String,String...]}
     */
    void deleteByUserIdAndModuleType(Map<String, Object> params);
}